let arr = [];
function add() {
    let n = prompt('请输入新增学员姓名：');
    if (!n) {
        alert('姓名不能为空');
        return;
    }
    if (!isNaN(n)) {
        alert('姓名不能为数字');
        return;
    }
    arr.push(n);
    console.log(arr);
}
let newArr = arr;
function show() {
    let count = 0;
    let name;
    for (let j = 0; j < newArr.length; j++) {
        count++;
    }
    document.write(`共${count}名学员，信息如下<br/>`);
    for (let j = 0; j < newArr.length; j++) {
        let name = newArr[j];
        document.write(name + ' ');
    }
}